<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>documentName</title>
    <link rel="stylesheet" href="" />
    <style>
      .box {
        border: 1px solid #ddd;
      }
      .active {
        padding: 20px;
      }
    </style>
  </head>
  <body>
    <button id="btn1">点击按钮</button>
    <div class="box">容器</div>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
    <script>
      $('#btn1').click(function () {
        $('.box').toggleClass('active')
      })
    </script>
  </body>
</html>
